package com.tencent.welink.api.msg;

import com.tencent.welink.api.OpenApiTokenChange;
import com.tencent.welink.api.base.WelinkOpenApi;
import com.tencent.welink.config.BussinessConfig;
import com.tencent.welink.util.CrontabUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Map;

/**
 * Created by junchihe on 2020/6/4.
 * desc: 通知平台发送文件在COS上链接到具体的设备
 */
public class FileNotify extends WelinkOpenApi {
    private static final Logger log = LogManager.getLogger(FileNotify.class);
    public FileNotify() {
        super("/common/msg/fileNotify", true);
    }

    @Override
    public void displayResult(String result) {

    }

    public static void main(String[] args) {
        new BussinessConfig();
        CrontabUtil.addTaskInRate(new OpenApiTokenChange(), BussinessConfig.loginDurationMinutes, true);
        FileNotify fileNotify = new FileNotify();
        Map<String, Object> map = fileNotify.getExtendsPara();

        map.put("fileId", "e5d4b574-b0e4-4748-8f6b-e3f7d2a03b9a");
        map.put("uploadResult","success");

        fileNotify.DoHttp();
        CrontabUtil.shutdown();
    }
}